package com.question_barrier.vo.user;

import com.question_barrier.entity.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("用户基本信息")
public class UserBasic {
    @ApiModelProperty("用户OpenId")
    private String openId;
    @ApiModelProperty("用户昵称")
    private String name;
    @ApiModelProperty("用户积分")
    private long integral;
    @ApiModelProperty("用户头像url")
    private String photoUrl;

    public UserBasic(String openId, String name, long integral, String photoUrl){
        this.openId = openId;
        this.name = name;
        this.integral = integral;
        this.photoUrl = photoUrl;
    }
    public UserBasic(User user){
        this.openId = user.getOpenId();
        this.name = user.getName();
        this.integral = user.getIntegral();
        this.photoUrl = user.getPhotoUrl();
    }
}
